﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InquiryRecords.aspx.cs" Inherits="ValuationClient.项目勘察.InquiryRecords" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
     <link href="../jquery-easyui-1.5.2/themes/default/easyui.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.5.2/themes/icon.css" rel="stylesheet" />
    <link href="../jquery-easyui-1.5.2/demo/demo.css" rel="stylesheet" />
    <script src="../js/jquery-1.8.2.min.js"></script>
    <script src="../jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
    <script src="../jquery-easyui-1.5.2/easyloader.js"></script>
    <script src="../js/jquery.params.js"></script>
</head>
<body>
    <div fit="true">
        <div style="padding: 3px">
            <a href="javascript:void(0) " class="easyui-linkbutton" data-options="iconCls:'icon-add',toggle:true" onclick="addxun()">新增询价</a>
        </div>
        <div>
            <table id="dg" class="easyui-datagrid" title="显示询价信息" toolbar="#tb" rownumbers="true" pagination="true"></table>
        </div>
    </div>
    <script type="text/javascript">

        Getdata();
        function Getdata() {
            //var name = $('#users_Name').val();
            $.ajax({
                type: "get",
                url: "http://localhost:55439/api/Project/EAInquiryList",
                dataType: "json",
                success: function (obj) {
                    obj = eval(obj);
                    $("#dg").datagrid({
                        columns: [[
                        { field: 'inquiry_Id', width: 150, title: '编号', align: 'center', closed: true },
                        { field: 'projectNumber', width: 150, align: 'center', title: '项目号' },
                        { field: 'inquiry_UnitPrice', width: 150, align: 'center', title: '建议评估单价' },
                        { field: 'inquiry_Content', width: 150, align: 'center', title: '询价内容及其他' },
                        { field: 'inquiry_Time', width: 150, align: 'center', title: '询价时间' },
                        { field: '_operate', width: 150, align: 'center' },
                        ]]
                    });
                    $("#dg").datagrid("loadData", obj);//动态取数据

                    var pager = $("#dg").datagrid("getPager");
                    pager.pagination({
                        beforePageText: '第',//页数文本框前显示的汉字 
                        afterPageText: '页 共 {pages} 页',
                        displayMsg: '共{total}条数据',
                        total: obj.length,
                        onSelectPage: function (pageNo, pageSize) {
                            var start = (pageNo - 1) * pageSize;
                            var end = start + pageSize;
                            $("#dg").datagrid("loadData", obj.slice(start, end));
                            pager.pagination('refresh', {
                                total: obj.length,
                                pageNumber: pageNo
                            });
                        }
                    });
                }
            })
        }

        //新增询价
        function addxun() {
            var P_ReportNumber = $.query.get("id");//项目号
            parent.addTab("新增询价", "/ProjectProspect/AddXunjia.aspx?id=" + P_ReportNumber, "icon-chart-organisation", true);
        }

    </script>
</body>
</html>
